package com.gopay.bis.dao.payconfig.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.gopay.bis.dao.payconfig.BisBankSpecialMerchantsDao;
import com.gopay.bis.domain.order.SpecialMerchants;
import com.gopay.common.base.dao.impl.BaseDAOImpl;
@Repository("bisBankSpecialMerchantsDao")
public class BisBankSpecialMerchantsDaoImpl extends BaseDAOImpl<SpecialMerchants, String> implements BisBankSpecialMerchantsDao{

	@Override
	public List<SpecialMerchants> getEnableSpecialMerchants() {
		String hql ="from SpecialMerchants where enable='1' ";
		List<SpecialMerchants> list = findByHql(hql);
		return list;
	}

	@Override
	public List getEnableSpecialMerchantsByMerId(String merId) {
		String hql ="from SpecialMerchants where enable='1' and merId=:merId";
		Map map = new HashMap();
		map.put("merId", merId);
		List<SpecialMerchants> list = findByHql(hql,map);
		return list;
	}

    @Override
    public List<SpecialMerchants> getEnableSpecialMerchantsByMerIdBank(String merId, String bank) {
        String hql ="from SpecialMerchants where (remark=:remark or remark is null) and enable='1' and merId=:merId ";
        Map map = new HashMap();
        map.put("merId", merId);
        map.put("remark", bank);
        List<SpecialMerchants> list = findByHql(hql,map);
        return list;
    }

}
